package HibernateUtilsforBM;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.junit.experimental.theories.Theories;
/**
 * 生成session
 * c3p0连接池
 */
public class SFactoryGenerator {
	private static SessionFactory factory;
	public static void setFactory(SessionFactory InitFactory){
		factory = InitFactory;
	}
	public static SessionFactory getFactory(){
		return factory;
	}
	public static Session getSession(){
		return factory.openSession();
	}
}
